export const getWeekOfMonth = (timestamp) => {
	const date = new Date(timestamp);
	// 获取当前日期是星期几
	const dayOfWeek = date.getDay();
	// 获取当前日期是一月中的第几天
	const dayOfMonth = date.getDate();
	// 获取当月第一天是星期几
	const firstDay = Math.floor((dayOfWeek + (7 - dayOfMonth % 7) + 1) % 7);
	// 计算目前过了几周
	const weekOfMonth = Math.floor(dayOfMonth / 7);
	// console.log(dayOfWeek, dayOfMonth, firstDay, weekOfMonth);
	if (firstDay === 0 && dayOfWeek === 6) {
		return weekOfMonth;
	} else if (firstDay === 0 || dayOfWeek === 6) {
		return weekOfMonth + 1;
	} else {
		if (dayOfWeek + 1 >= firstDay) {
			return weekOfMonth + 1;
		} else {
			return weekOfMonth + 2;
		}
	}
}